//
//  BaseModel.m
//  UI_豆瓣
//
//  Created by 赵磊 on 15/12/24.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel
- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+ (instancetype)modelWithDic:(NSDictionary *)dic
{
    return [[[self class] alloc] initWithDic:dic];
}
+ (NSMutableArray *)modelHandlerWithArray:(NSArray *)arr
{
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        [mArr addObject:[[self class] modelWithDic:dic]];
    }
    return mArr;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
@end
